include_directories(${PROJECT_SOURCE_DIR}/src ${OPENSSL_INCLUDE_DIR} ${LIBEVENT_INCLUDE_DIR}/include)

if (WIN32 OR CYGWIN)
	include_directories(${LIBEVENT_INCLUDE_DIR}/WIN32-Code)
endif (WIN32 OR CYGWIN)

if (UNIX)
    set (BMTP_LIBS ${BMTP_LIBS} event event_core event_extra event_pthreads pthread)
endif (UNIX)

set (BMTP_LIBS ${BMTP_LIBS} ${OPENSSL_LIBRARIES})

#if (UNIX)
#	if (APPLE)
#		set (BMTP_LIBS ${BMTP_LIBS} dl m)
#	else (APPLE)
#		set (BMTP_LIBS ${BMTP_LIBS} rt dl m)
#	endif (APPLE)
#endif (UNIX)

if (WIN32)
	set (BMTP_LIBS ${BMTP_LIBS} ${LIBEVENT_INCLUDE_DIR}/libevent.lib ${LIBEVENT_INCLUDE_DIR}/libevent_extras.lib ${LIBEVENT_INCLUDE_DIR}/libevent_core.lib)
	set (BMTP_LIBS ${BMTP_LIBS} ws2_32)
	add_definitions("-D_CRT_SECURE_NO_WARNINGS")
	add_definitions("-D_CRT_NONSTDC_NO_DEPRECATE")
endif (WIN32)

set (BENCHMARK_SRCS
	benchmark.c)

if (WIN32 OR CYGWIN)
	set (BENCHMARK_SRCS ${BENCHMARK_SRCS}
	windows/dllmain.c)
endif (WIN32 OR CYGWIN)

add_executable(benchmark ${BENCHMARK_SRCS})
target_link_libraries(benchmark bmtp_static ${BMTP_LIBS})

set (BMF_SRCS
	bmf.c)

add_executable(bmf ${BMF_SRCS})
target_link_libraries(bmf bmtp_static ${BMTP_LIBS})
